package com.wlcj.www.model.platform;

import com.jfinal.plugin.activerecord.Model;
import com.wlcj.util.CacheKeyUtil;
import com.wlcj.util.RedisUtil;
import com.wlcj.util.SqlUtil;

public class PlatformPrice extends Model<PlatformPrice> {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4055758622600047767L;
	
	public static final PlatformPrice dao = new PlatformPrice();
	
	public PlatformPrice getCachePlatformPriceByPid(int pid) {
		String key = CacheKeyUtil.getPlatformPriceKey(pid);
		PlatformPrice p = RedisUtil.get(key);
		if(p==null) {
			p = findFirst(SqlUtil.sql("platform.getPlatformPriceByPid"), pid);
			RedisUtil.set(key, p);
		}
		return p;
	}

}
